package com.example.addressbook.service;

import com.example.addressbook.dao.GroupRepository;
import com.example.addressbook.entities.Grouping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GroupService {
    
    @Autowired
    GroupRepository groupRepository;
    public Grouping save(Grouping group) {
        return groupRepository.save(group);
    }

    public List<Grouping> findAll() {
        return groupRepository.findAll();
    }

    public Grouping findById(long thId) {
        return groupRepository.findById(thId);
    }


    public void delete(Grouping thGroup) {

        groupRepository.delete(thGroup);
    }
}
